<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script type="text/javascript" src="${staticServer}/common/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript" src="${staticServer}/js/web/uploadImg.js?1.5"></script>
<script type="text/javascript" src="${staticServer}/common/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
var contextPath='${contextPath}';
var _contextPath = '${staticServer}';


var update2 = function(){
	var id = $("#tjId").val();
	var xz_state = $("#xz_state").val();
	var zs_msg = $("#zs_msg").val();
	if(xz_state==null || xz_state==""){
		alert("请选择审核状态!");
		return;
	}
	var url ="${contextPath}/index/save_sh.json";
    $.post(url, {"id":id,"xz_state":xz_state,"zs_msg":zs_msg},function(ms) {
			if(ms.msg == "1"){
			     infopad.msg("添加成功");
				 setTimeout(function(){
				 window.location.href=encodeURI("${contextPath}/index/tuijianList.htm");
			  },1000);
		    }else{
		      	alert("抱歉，系统忙,请重新保存！");
		     }
    	});
}
/**
 * 保存客户推荐记录
 */
var update = function(){
	var cp_date = $("#cp_date").val();
	var cp_center = $("#cp_center").val();
	if(cp_date==null || cp_date=="" || cp_center==null || cp_center==""){
		alert("还未填写成单补充，暂时不能审核通过！");
		return;
	}

	var id = $("#tjId").val();
	var zs_jiaofei_date = $("#zs_jiaofei_date").val();
	var zs_jiaofei_jine = $("#zs_jiaofei_jine").val();
	var zs_ke_detail = $("#zs_ke_detail").val();
	var zs_tuijian_zj = $("#zs_tuijian_zj").val();
	var zs_msg = $("#zs_msg").val();
	var url ="${contextPath}/index/updatetuijiansh.json";
    $.post(url, {"id":id,"zs_msg":zs_msg,"zs_jiaofei_date":zs_jiaofei_date,
    				"zs_jiaofei_jine":zs_jiaofei_jine,"zs_ke_detail":zs_ke_detail,"zs_tuijian_zj":zs_tuijian_zj,
    				"cp_date":cp_date,"cp_center":cp_center
    			},function(ms) {
    				if(ms.msg == "1"){
    			     	infopad.msg("添加成功");
    				  	setTimeout(function(){
    					window.location.href=encodeURI("${contextPath}/index/tuijianList.htm");
    				},1000);
    		      }else{
    		      		alert("抱歉，系统忙,请重新保存！");
    		      }
    	});
}
</script>
</head>
<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>咨询师业务管理</li>
			<li>&gt;</li>
			<li class="current">推荐学员明细补充</li>
		</ul>
	</div>
	<div id="container">
		<table class="fields">
		<#if tuijian??>
			<tr>
				<td>
				<input type="hidden" id="tjId" value="<#if tuijian??>${tuijian.id}</#if>"/>
				推荐类别：${tuijian.tuijian_type}<#if tuijian.mingxi?? && tuijian.mingxi!="">,,资源来源明细：${tuijian.mingxi}</#if><br>
             	推荐学员：${tuijian.stu_name}<br>
             	是否第一次推荐：${tuijian.is_first}<#if tuijian.times?? && tuijian.times!="">,${tuijian.times}次</#if><br>
             	入学时间：${tuijian.baoming_date?date}<br>
             	目前上课次数：${tuijian.mqkeci}<br>
             	被推荐学员：${tuijian.tuijian_name}<br>
             	与推荐人谈推荐的时间、内容(第一次)：${tuijian.tuijian_time1?date}，${tuijian.content1}<br>
             	与推荐人谈推荐的时间、内容(第二次)：${tuijian.tuijian_time2?date}，${tuijian.content2}<br>
             	与推荐人谈推荐的时间、内容(第三次)：${tuijian.tuijian_time3?date}，${tuijian.content3}<br>
             	推荐人动机：${tuijian.tuijian_dj}<br>
             	具体许诺推荐人的赠送课时或返学费情况：${tuijian.tuijian_kes}<br>
             	知道推荐人将要推荐该学生的日期：${tuijian.tjstu_time?date}<br>
             	被推荐人与推荐人的关系：${tuijian.guanxi}<br>
             	推是否有其他老师参与推荐：${tuijian.is_canyu}<br>
             	参与推荐老师：${tuijian.cy_tuijian_teacher}<br>
             	<br>
             	<h3 style="font-size: 18px; font-weight:bold">成单补充：</h3><br>
             	测评日期：<#if tuijian.cp_date??>${tuijian.cp_date?date}<#else></#if><br>
             	测评中心：<#if tuijian.cp_center??>${tuijian.cp_center}</#if><br>
             	缴费日期：<#if tuijian.jiaofei_date??>${tuijian.jiaofei_date?date}<#else></#if><br>
             	缴费金额：<#if tuijian.jiaofei_jine??>${tuijian.jiaofei_jine}元.</#if><br>
             	课程情况：<#if tuijian.ke_detail??>${tuijian.ke_detail}</#if><br>
             	推荐总结：<#if tuijian.tuijian_zj??>${tuijian.tuijian_zj}</#if><br>
             	上传证明材料：<ul class="imglist">
					<div id="imagesfw" style="float: left;">
						<#if tuijian?? && tuijian.url?? && tuijian.url!="">
							<#list tuijian.url?split(",") as imgurl>
								<#if imgurl_index !=0>
								<li id="${imgurl?replace('http://120.55.241.58/','')?substring(25,30)}" onclick="deleteImgfw('${imgurl?replace('http://120.55.241.58/','')?substring(25,30)}','${imgurl}')" style="float:left;list-style-type: none;line-height:180px;*font-size:157px;"><img rel="800:485" width="180" height="109.125" src="http://120.55.241.58/${imgurl}"></li>
								</#if>
							</#list>
						</#if>
					</div>
					<a class="file_box" style="list-style-type: none;float: left;display: block; width:180px; height:180px; overflow: hidden; border: 1px solid #EBEBEB; background: none repeat scroll 0 0 #F3F3F3; color: #999999; cursor: pointer; text-align: center; margin-left:10px; ">
                    <em style="background:url(${staticServer}/img/add_newpic.png) 0 0; display: inline-block; width:180px; height:180px; overflow: hidden;line-height: 20em; vertical-align: middle;">
                    <input type="file" id="uploadfw" style="display: block;width:180px; height:180px;opacity: 0; filter:alpha(opacity=0); "></em>
                    </a>
                    <label class="zt_widthlabel" style=" font-size:9px; float:left; visibility:hidden;">文件：</label>
                    <input type="text" id="fw" value="<#if tuijian??>${tuijian.url}</#if>" style=" width:100px; height:10px; float:left;visibility:hidden;" class="input w180" value="">
					</ul>
					<br/>
				</td>        	
        	</tr>
        	<#if userId?? && userId!="550">
         	<#if tuijian.cp_date??>
        		
				<#else>
				<tr><td><h3 style="font-size: 18px; font-weight:bold">成单补充：</h3><td></tr>
             	<tr><td>测评日期：<input type="text" id="cp_date" size="20" maxlength="20" value="" rel="DATE::Y-m-d"/><td></tr>
             	<tr><td>测评中心：
				<select id="cp_center">
             			<option value="">请选择</option>
             			<#if cenList??>
             				<#list cenList as cenList>
             					<#if cenList??>
								<option value="${cenList.id}">${cenList.center}</option>
								</#if>
							</#list>
						</#if>
					</select>
				</td></tr>
				<tr><td>缴费日期：<input type="text" id="zs_jiaofei_date" size="20" maxlength="20" rel="DATE::Y-m-d" value=""/><td></tr>
             	<tr><td>缴费金额：<input type="number" id="zs_jiaofei_jine" value="" size="20"><td></tr>
             	<tr><td>课程情况：<input type="text" id="zs_ke_detail" value="" size="50"><td></tr>
				<tr><td>推荐总结：<input type="text" id="zs_tuijian_zj" value="" size="50"><td></tr>
				<tr>
				<td align="center" ><input type="button"  value=" 保存客户推荐记录 " onclick="update()" class="submit" id="easyDialogYesBtn"/> </td>
				</tr>
				</#if>
				</#if>
				<#if userId?? && userId=="483" || userId=="550" >
					<tr><td>审核状态：
						<select id="xz_state" value="">
							<option value="">请选择</option>
							<option value="2" <#if tuijian.xz_state=="2">selected="selected"</#if> >通过</option>
							<option value="1" <#if tuijian.xz_state=="1">selected="selected"</#if>>不通过</option>
						</select>
					<td></tr>
					<tr><td>赠送课时情况：
					<input id="zs_msg"  type="text" size="20" value="${tuijian.tuijian_kes}"/>次。
					<td></tr>
	             	<br/>
	             <tr>
					<td align="center" >
						<#if tuijian.xz_state=="0" || tuijian.xz_state=="" || userId=="483" || userId=="550">
							<input type="button"  value="确定审核" onclick="update2()" class="submit" id="easyDialogYesBtn"/>
						</#if>
					</td>
				</tr>
			</#if>
			</#if>
		</table>
	</div>
	
</body>
</html>